﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

[PrimaryKey("gw_id", "gw_code")]
[Index("gw_code", Name = "idxcode", IsUnique = true)]
[Index("gw_deviceid", Name = "idxdeviceid")]
[Index("gw_d_guid", Name = "idxdguid", IsUnique = true)]
[Index("gw_guid", Name = "idxdhsguid")]
[MySqlCharSet("utf8mb3")]
[MySqlCollation("utf8mb3_general_ci")]
public partial class iot_device_gateway
{
    [Key]
    public long gw_id { get; set; }

    /// <summary>
    /// init/devicecode.txt配置
    /// </summary>
    [Key]
    [StringLength(50)]
    public string gw_code { get; set; }

    [Required]
    [StringLength(50)]
    public string gw_guid { get; set; }

    /// <summary>
    /// 设备id
    /// </summary>
    [StringLength(100)]
    public string gw_deviceid { get; set; }

    /// <summary>
    /// 机器型号
    /// </summary>
    [StringLength(100)]
    public string gw_machine_name { get; set; }

    /// <summary>
    /// 机子启动时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? gw_start_time { get; set; }

    /// <summary>
    /// 最近活跃时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? gw_live_time { get; set; }

    /// <summary>
    /// 软件版本号
    /// </summary>
    [StringLength(50)]
    public string gw_software_version { get; set; }

    /// <summary>
    /// 0未知，1正常，2异常
    /// </summary>
    public int? gw_live_state { get; set; }

    /// <summary>
    /// 设定查询状态时间 秒
    /// </summary>
    public long? gw_live_set_interval_time { get; set; }

    [StringLength(500)]
    public string gw_mac { get; set; }

    /// <summary>
    /// 系统登录信息
    /// </summary>
    [StringLength(50)]
    public string gw_system_login_info { get; set; }

    /// <summary>
    /// 操作系统
    /// </summary>
    [StringLength(50)]
    public string gw_system { get; set; }

    /// <summary>
    /// 机器型号
    /// </summary>
    [StringLength(50)]
    public string gw_machine_model { get; set; }

    public string gw_d_guid { get; set; }

    [StringLength(100)]
    public string gw_local_ip { get; set; }

    [StringLength(50)]
    public string gw_local_port { get; set; }

    [StringLength(50)]
    public string gw_remote_ip { get; set; }

    /// <summary>
    /// cpu温度
    /// </summary>
    [StringLength(50)]
    public string gw_cpu_temperature { get; set; }

    /// <summary>
    /// gpu温度
    /// </summary>
    [StringLength(50)]
    public string gw_gpu_temperature { get; set; }

    /// <summary>
    /// 总内存
    /// </summary>
    public int? gw_memory_total { get; set; }

    /// <summary>
    /// 已使用内存
    /// </summary>
    public int? gw_memory_use { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? gw_mod_time { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? gw_add_time { get; set; }

    /// <summary>
    /// 空余内存
    /// </summary>
    public int? gw_memory_empty { get; set; }

    [StringLength(900)]
    public string gw_system_start_code { get; set; }

    [StringLength(900)]
    public string gw_wifi_name { get; set; }

    [StringLength(900)]
    public string gw_wifi_pwd { get; set; }

    /// <summary>
    /// 密钥key
    /// </summary>
    [StringLength(255)]
    public string gw_key { get; set; }
}
